package com.giscloud;

import com.google.common.base.Stopwatch;
import lombok.extern.log4j.Log4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;

import java.util.concurrent.TimeUnit;

@SpringBootApplication
@MapperScan("com.giscloud.generator.dao")
@Log4j
public class GiscloudGeneratorApplication {

    public static void main(String[] args) {

        Stopwatch stopwatch = Stopwatch.createStarted();
        log.error("giscloud代码生成器开始启动。。。。。。");
        ConfigurableApplicationContext context = SpringApplication.run(GiscloudGeneratorApplication.class, args);
        Environment environment = context.getBean(Environment.class);
        long second = stopwatch.elapsed(TimeUnit.SECONDS);
        log.error("giscloud代码生成器启动成功,启动时间:" + second + "秒,访问链接：http://127.0.0.1:"+environment.getProperty("server.port"));
    }
}
